<?php
require_once("../lib/DbWrapper.class.php");
require("../libs/Smarty.class.php");
$smarty = new Smarty;

$nickname = $_POST["nickname"];
$mailaddress = $_POST["mailaddress"];
$password = $_POST["password"];
$admin_yn = ($_POST["admin_yn"]=="y")?"y":"n";//三項演算子でyn

DbWrapper::dbChoice();

//クエリを送信する
$sql = "INSERT INTO member
        (nickname, mailaddress, password, admin_yn, created_at)
        VALUES (\"".$nickname."\",\"".
                     $mailaddress."\",\"".
                     $password."\",\"".
                     $admin_yn."\",\"".
                     date("Y-m-d H:i:s")."\")";
$result = mysql_query($sql);

//$body = "会員登録がありました";
//mb_send_mail("mis019nishi@gmail.com","会員登録がありました。",$body);

$smarty->display("member_add_result.tpl");